﻿@model IEnumerable<Transport.Models.AccountForListModel>
@{
    Layout = null;
}
<script src="@Url.Content("~/Scripts/js/script_control_userselected.js")" type="text/javascript"></script>

@foreach (var item in Model)
{
    <section class="group">
        <header class="title_seleted_0">
            <div class="checkbox">
                <input type="checkbox" name='chkAccounts' class="chk_account @(item.IsDisable == false ? "enabled" : "disabled")" id="@("Checkbox" + item.AccountId.ToString())" value="@item.AccountId">
                <label for="@("Checkbox" + item.AccountId.ToString())">
                </label>
            </div>
            <div class="status">
                <a class="@(item.IsDisable == false ? "liveicon" : "disableicon")">
                    <text>@(item.IsDisable == false ? "ENABLED" : "DISABLED")</text>
                </a>
            </div>
            <div class="company">
                <div class="subtitle">
                    COMPANY NAME</div>
                <div class="name">
                    @item.CompanyName</div>
            </div>
            <div class="package">
                <div class="subtitle">
                    PACKAGE</div>
                <div class="name">
                    @item.PackageName</div>
            </div>
            <div class="site">
                <div class="subtitle">
                    SITES</div>
                <div class="name">
                    @item.Sites</div>
            </div>
            <div class="url">
                <div class="subtitle">
                    URLS</div>
                <div class="name">
                    @item.URLS</div>
            </div>
            <div class="page">
                <div class="subtitle">
                    SERVED PAGES</div>
                <div class="name">
                    @item.PageViews</div>
            </div>
            <div class="data">
                <div class="subtitle">
                    DATA ALLOWANCE</div>
                <div class="name">
                    @string.Format("{0}MB", item.DataAllowance)</div>
            </div>
        </header>
        <dl class="site_select_group">
            @foreach (var user in item.Users)
            {
                <dt id="sitename1_item">
                    <div class="col_checkbox">
                        <input type="checkbox" name='chkUsers' class="chk_user @((item.IsDisable == false && user.IsLockedOut == false) ? "enabled" : "disabled")" value="@user.UserId" id="@("sitename" + item.AccountId.ToString() + "_" + user.UserId.ToString())">
                        <label for="@("sitename" + item.AccountId.ToString() + "_" + user.UserId.ToString())">
                        </label>
                    </div>
                    <div class="col_status">
                        <a class="@((item.IsDisable == false && user.IsLockedOut == false) ? "liveicon" : "disableicon")">
                            <text>@(user.IsLockedOut == false ? "ENABLED" : "DISABLED")</text>
                        </a>
                    </div>
                    <div class="col_sitename border-none">
                        @user.ContactName</div>
                    <div class="user_group">
                        @if (@user.RoleName.ToUpper() == "ADMIN")
                        { 
                            <div class="adminicon">@user.RoleName.ToUpper()</div>
                        }
                        else
                        { 
                            <div class="adminicon user">@user.RoleName.ToUpper()</div>
                        }
                    </div>
                </dt>
            }
        </dl>
    </section>
}
@if (Model.Count() <= 0)
{
    <section style="padding: 10px;clear: both;">
        <span style="color:Red">No data</span>
    </section>
}
